#include <stdio.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <string.h>
#include <stdlib.h>


int main(int argc, char const *argv[])
{
    int sockfd=socket(AF_INET,SOCK_DGRAM,0);

    struct sockaddr_in serveraddr;
    serveraddr.sin_addr.s_addr=inet_addr(argv[1]);
    serveraddr.sin_family=AF_INET;
    serveraddr.sin_port=htons(atoi(argv[2]));
    
    socklen_t addrlen=sizeof(serveraddr);

    char sendbuf[128]={0};

    while(1)
    {
        printf("plz input >>\n");
        scanf("%s",sendbuf);
        sendto(sockfd,sendbuf,128,0,(struct sockaddr *)&serveraddr,addrlen);
        memset(sendbuf,0,128);
    }
    return 0;
}
